package com.futao.springbootlearn20220224.event;

import lombok.*;
import org.springframework.context.ApplicationEvent;


/**
 * @author futao
 * @date
 */
@Getter
public class UserRegisterEvent extends ApplicationEvent {

    private NewUser newUser;

    /**
     * @param source 发生这个事件的对象（发生这个事件的地方）
     */
    public UserRegisterEvent(Object source, NewUser newUser) {
        super(source);
        this.newUser = newUser;
    }


    @Getter
    @Setter
    @ToString
    @NoArgsConstructor
    @AllArgsConstructor
    public static class NewUser {
        private Long id;
        private String username;
    }
}
